extends PopupDialog

onready var level_manager : LevelsManager = $"/root/Main/Level"

onready var level_label : Label = $"CurrentLevel"

onready var level_screenshot : TextureRect = $"Screenshot"
	
func show():
	var current_level = level_manager.level
	level_label.text = "魔塔 第%0*dF" % [2,current_level]
	var image = get_viewport().get_texture().get_data()
	image.flip_y()
	var texture = ImageTexture.new()
	texture.create_from_image(image,image.get_format())
	level_screenshot.texture = texture
	visible = true
	
func _on_Close_pressed():
	visible = false
